//
//  JSMIDI.h
//  
//
//  Modified from Occam by C. Ramakrishnan
//

#import <Foundation/Foundation.h>
#import <CoreMIDI/CoreMIDI.h>

@class PyobjCMidiPlugIn;

@interface JSMIDI : NSObject {

	MIDIClientRef   _midiClient;
	MIDIPortRef     _outputPort;
	MIDIEndpointRef _source;
	
	PyobjCMidiPlugIn* _controller; // reference to controller so I can send status messages

}

#pragma mark _____ initialization
- (id)initWithController:(PyobjCMidiPlugIn*)controller;

#pragma mark _____ Midi actions
- (void)statusMessage:(NSString*)message;

- (void)sendNoteOnChannel:(int)channel key:(int)key velocity:(int)velocity;
- (void)sendNoteOffChannel:(int)channel key:(int)key velocity:(int)velocity;
- (void)sendPolyPressureOnChannel:(int)channel key:(int)key pressure:(int)pressure;
- (void)sendControlChangeOnChannel:(int)channel index:(int)index value:(int)value;
- (void)sendProgramChangeOnChannel:(int)channel index:(int)index;
- (void)sendChannelPressureOnChannel:(int)channel pressure:(int)pressure;
- (void)sendPitchWheelOnChannel:(int)channel value:(int)value;

#pragma mark _____ accessors
- (NSString*)midiSourceName;

@end